package com.ardrone.revue;

import java.net.DatagramPacket;
import java.net.DatagramSocket;
import java.net.InetAddress;

public class Atterissage extends Thread 
{
				
@Override public void run()
		{
			
	        int port = 5556;
	        String envoiMessage= "AT*REF=4,290717696\r";
	        int taille = envoiMessage.length();
	        byte[] message = new byte[taille];
	        message = envoiMessage.getBytes();
	        byte[] ip = {(byte)192, (byte)168, (byte)1, (byte)1 };
	        
	        
	        try 
	    { 
	            DatagramSocket socket = new DatagramSocket();
	            InetAddress address = InetAddress.getByAddress(ip);
	            DatagramPacket packet = new DatagramPacket(message, taille, address, port); 
	            socket.send(packet);
	            socket.close();
	    }
	        catch (Exception e) 
	        {
	        	e.printStackTrace();
	        }
	 
	    }
	 
}
